package com.evil.application.pojo.dto.order.node;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.Objects;

/**
 * 订单节点统计 返回实体
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class AuditNodeStatisticsRespDTO {

    /**
     * 节点id
     */
    private Long nodeId;

    /**
     * 节点名称
     */
    private String nodeName;

    /**
     * 数量
     */
    private Integer count;

    public AuditNodeStatisticsRespDTO(OrderProcessStatisticsBO orderProcessStatisticsBO) {
        this.nodeId = orderProcessStatisticsBO.getNodeId();
        this.nodeName = orderProcessStatisticsBO.getNodeName();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        AuditNodeStatisticsRespDTO that = (AuditNodeStatisticsRespDTO) o;
        return Objects.equals(nodeId, that.nodeId) &&
                Objects.equals(nodeName, that.nodeName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(nodeId, nodeName);
    }
}
